<script type="text/javascript"> 
 
    $(document).ready(function(){ 
		// initialise Superfish 
        $("ul.sf-menu").superfish({ 
            pathClass:  'Menus' 
        }); 
    }); 
 
</script>
New menu 
<br />
	    <br />
		<?php echo $form->create('Menu', array('type' => 'file'));?>
		<fieldset>
			<legend>English version</legend>
			<?php echo $form->input('Menu.name_eng', array('label'=>'Name<br>'));?>
			<?php echo $form->input('Menu.image_eng_passive', array('label'=>'Image (passive mode)<br />', 'type' => 'file'));?>
			<?php echo $form->input('Menu.image_eng_active', array('label'=>'Image (active mode) (passive mode required)<br />', 'type' => 'file'));?>
			<?php echo $form->input('Menu.image_eng_hover', array('label'=>'Image (hover mode) (passive mode required)<br />', 'type' => 'file'));?>
		</fieldset>	
		<br />
		<fieldset>
			<legend>Russian version</legend>
			<?php echo $form->input('Menu.name_rus', array('label'=>'Name<br>'));?>
			<?php echo $form->input('Menu.image_rus_passive', array('label'=>'Image (passive mode)<br />', 'type' => 'file'));?>
			<?php echo $form->input('Menu.image_rus_active', array('label'=>'Image (active mode) (passive mode required)<br />', 'type' => 'file'));?>
			<?php echo $form->input('Menu.image_rus_hover', array('label'=>'Image (hover mode) (passive mode required)<br />', 'type' => 'file'));?>
		</fieldset>	
		<br />
		<fieldset>
			<legend>Armenian version</legend>
			<?php echo $form->input('Menu.name_arm', array('label'=>'Name<br>'));?>
			<?php echo $form->input('Menu.image_arm_passive', array('label'=>'Image (passive mode)<br />', 'type' => 'file'));?>
			<?php echo $form->input('Menu.image_arm_active', array('label'=>'Image (active mode) (passive mode required)<br />', 'type' => 'file'));?>
			<?php echo $form->input('Menu.image_arm_hover', array('label'=>'Image (hover mode) (passive mode required)<br />', 'type' => 'file'));?>
		</fieldset>	
		<br />
		<?php 
			echo $form->input('Menu.url', array(
					'label'=>'Select the page, where this menu should link to OR choose other and type a URL yourself<br />',
					'onchange'=>'MM_jumpMenu(this); ',
					'options' => $contentsUrls
			));?>
		<?php echo $form->input('Menu.url_other', array(
						'style'=>'display:none;',
						'label'=>'<br>'
					));?>
		
		<?php 
			$topMenus = $this->requestAction('/menus/getTopMenus');
			$topMenusNames['-1'] = '-no parrent-';
			foreach ($topMenus as $topMenu){
				$topMenusNames[$topMenu['Menu']['id']]=$topMenu['Menu']['name_eng'];
			}
			echo $form->input('Menu.parent_id', array(
					'label'=>'<br>Select parent menu<br />',
					'options' => $topMenusNames
					)
				);
		?>
		
		
		<br />
		
		<?php
		echo $form->end('Add');
		?>
		
<script type="text/JavaScript">

function MM_jumpMenu(selObj){ //v3.0
//console.log(selObj.options[selObj.selectedIndex].value);
  if(selObj.options[selObj.selectedIndex].value=="-2") {
  	document.getElementById("MenuUrlOther").style.display="block";
  }
  else {
	  if(selObj.options[selObj.selectedIndex].value=="-1"){
  		document.getElementById("MenuUrlOther").style.display="none";
		alert("Select the url, or choose other to type your oun URL");
	  }
	  else{
  		document.getElementById("MenuUrlOther").style.display="none";
	  }
  }
  //eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  //if (restore) selObj.selectedIndex=0;
}

</script>